﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

using PSLibrary = Microsoft.Office.Project.Server.Library;
using MSProject = Microsoft.Office.Interop.MSProject;

namespace DataDesign.MPP.AddIn.Manager
{
    public class ProjectAppManager
    {
        private static log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
                
        public static void OpenProject(MSProject.Application application, string filePath)
        {
            //application.FileOpenEx(Name: filePath, Table: "Entry", openPool: MSProject.PjPoolOpen.pjPoolReadWrite);

            application.FileOpenEx(filePath, Missing.Value, Missing.Value, Missing.Value,
                                    "Entry",
                                    Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
                                    Missing.Value, MSProject.PjPoolOpen.pjPoolReadWrite, Missing.Value, Missing.Value,
                                    Missing.Value, Missing.Value, Missing.Value);
        } 
    }
}
